package com.example.magicapi.util;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class RestResult implements Serializable {
    private static final long serialVersionUID = 8719007507834439109L;
    private Integer state;
    private String msg;
    private Map<String, Object> results;
    private String subCode;
    private String subMsg;

    public String getSubCode() {
        return this.subCode;
    }

    public void setSubCode(String subCode) {
        this.subCode = subCode;
    }

    public String getSubMsg() {
        return this.subMsg;
    }

    public void setSubMsg(String subMsg) {
        this.subMsg = subMsg;
    }

    public RestResult() {
    }

    public RestResult(Integer state, String msg, Map<String, Object> results) {
        this.state = state;
        this.msg = msg;
        this.results = results;
    }

    public RestResult(Integer state, String msg, String key, Object value) {
        this.state = state;
        this.msg = msg;
        Map<String, Object> results = new HashMap();
        results.put(key, value);
        this.results = results;
    }

    public Integer getState() {
        return this.state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Map<String, Object> getResults() {
        return this.results;
    }

    public void setResults(Map<String, Object> results) {
        this.results = results;
    }
}
